<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>

        
        function Parent(){
            this.x=0;
            this.y=1;
        }

        function Child(){
            this.w=100;
            this.h=100;
            //通过call和apply实现了继承
            Parent.call(this);//将来通过Childnew出来对象，去调用Parent函数
           
        }
       
        var c=new Child();
        console.log(c);

        var c2=new Child();
        console.log(c2);

    </script>
</head>
<body>
    
</body>
</html>